/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

@Entity
@javax.persistence.Table(name="payment")
public class Payment implements Serializable {

    @Id
    @Column(name="payment_id")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Integer id;

    @ManyToOne
    @JoinColumn(name="receipt_id")
    private Receipt receipt;

    @Enumerated(EnumType.ORDINAL)
    private PaymentType type;

    @Enumerated(EnumType.ORDINAL)
    private PaymentStatus status;

    @OneToOne
    @JoinColumn(name="confirmation_id")
    private PaymentConfirmation confirmation;

    public Payment(){
        this.status = PaymentStatus.DEFAULT;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the receipt
     */
    public Receipt getReceipt() {
        return receipt;
    }

    /**
     * @param receipt the receipt to set
     */
    public void setReceipt(Receipt receipt) {
        this.receipt = receipt;
    }

    /**
     * @return the type
     */
    public PaymentType getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(PaymentType type) {
        this.type = type;
    }

    /**
     * @return the status
     */
    public PaymentStatus getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(PaymentStatus status) {
        this.status = status;
    }

    /**
     * @return the confirmation
     */
    public PaymentConfirmation getConfirmation() {
        return confirmation;
    }

    /**
     * @param confirmation the confirmation to set
     */
    public void setConfirmation(PaymentConfirmation confirmation) {
        this.confirmation = confirmation;
    }

}
